#include "widget.h"
#include "ui_widget.h"
#include <QFileDialog>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    connect(ui->pushButton,&QPushButton::clicked,[=](){
        QString path = QFileDialog::getOpenFileName(this,"打开文件","C:\\Users\\14725\\Desktop");
        ui->lineEdit->setText(path);
        QFile file(path);
        file.open(QIODevice::Append);
        file.write("写进去的字");
        file.close();
    });
}

Widget::~Widget()
{
    delete ui;
}

